# -*- coding:utf-8 -*-
import pytest
import allure
from selenium import webdriver

from pages.login import Login
from handle.handle_log import log


class TestLogin(object):

    def setup_class(self):
        self.driver = webdriver.Chrome()
        self.url = "http://ecp.gzctdi-test.com/tenement/"

    def teardown_class(self):
        self.driver.quit()
        print("teardown_class结束")

    @pytest.mark.run(order=1)
    @allure.title("登录用列")
    def testlogin(self):
        lg = Login(self.driver, self.url)
        check = lg.login()
        try:
            assert check == "返回首页"
        except Exception as e:
            log.error(e)



